﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace SuperMarioClone.Managers
{
    class Content_Manager
    {
        private static Content_Manager instance;
        ContentManager CN;
        public Dictionary<String, Texture2D> Textures;
        
        private Content_Manager()
        { 
            Textures = new Dictionary<string,Texture2D>();
        
        }

        public static Content_Manager getInstance()
        {
            if (instance == null)
                instance = new Content_Manager();
            return instance;
        }

        public void LoadTexture(ContentManager Content )
        {
            CN = Content;
            Addtexture("mario_sprite","mario1");
            Addtexture("menu","menu");
            Addtexture("tile_brown_1");
            Addtexture("scenery_1");
            Addtexture("scenery_2");
             
        }
        public void Addtexture(String file, String name = "")
        {
            Texture2D newTexture = CN.Load<Texture2D>(file);
            if (name == "")
                Textures.Add(file, newTexture);
            else
                Textures.Add(name, newTexture);
        }
    }
}
